package com.mdx.zhizhao.service;


import com.mdx.zhizhao.domain.Enterprise;
import com.mdx.zhizhao.domain.Seeker;
import com.mdx.zhizhao.persistence.SeekerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

@Service
public class SeekerService {
    @Autowired
    private SeekerMapper seekerMapper;
    public void signup(Seeker seeker){
        seekerMapper.insert(seeker);
    }
    public void updateSeeker(Seeker seeker){
        seekerMapper.updateById(seeker);
    }
    public void deleteSeeker(String seekerId){
        seekerMapper.deleteById(seekerId);
    }
    public Seeker selectSeeker(String seekerId){
        return seekerMapper.selectById(seekerId);
    }
    public Seeker login(String id , String pwd){
        Seeker seeker = seekerMapper.selectById(id);
        if(Objects.equals(pwd, seeker.getSeekerpassword())){
            return seeker;
        }else{
            return null;
        }
    }

}
